import ajax from './ajax'
const BASE_URL = process.env.NODE_ENV=="development"?'http://dxsd.jlxmall.com':'http://dxsd.jlxmall.com'
// const BASE_URL = 'http://192.168.0.103'
import qs from 'qs'
// 1. 登录
export const login = (data) => ajax(`${BASE_URL}/login/verify_second`, qs.stringify(data), 'POST')
// 2.获取学校列表
export const getSchoolList = () => ajax(`${BASE_URL}/Login/school_list`, null, 'POST')
// 3.根据学校id获取楼栋
export const getFloorList = (school_id) => ajax(`${BASE_URL}/login/select_storied`, qs.stringify({school_id}), 'POST')
// 4.获取商家列表
export const getStoreList = (data) => ajax(`${BASE_URL}/Shop/store_list`,qs.stringify(data),'POST')
// 5.获取商家信息
export const getShopInfo = (data) => ajax(`${BASE_URL}/Shop/store_info`,qs.stringify(data),'POST')
// 6.获取商家下商品
export const getGoodsList = (data) => ajax(`${BASE_URL}/Shop/goods_list`,qs.stringify(data),'POST')
// 7.获取商家营业信息
export const getStoreBusiness = (data) => ajax(`${BASE_URL}/Shop/store_business`,qs.stringify(data),'POST')
// 8.模糊查询获取商家列表
export const searchShopList = (data) => ajax(`${BASE_URL}/Shop/vague_store_list`,qs.stringify(data),'POST')
// 9.获取商户评论
export const orderReview = (data) => ajax(`${BASE_URL}/Shop/Order_review`,qs.stringify(data),'POST')
// 10.退出登录
export const loginOut = ()=> ajax(`${BASE_URL}/login/login_out`,null,'POST')
// 11.修改收货地址
export const editAddress = (data) => ajax(`${BASE_URL}/Shop/edit_address`,qs.stringify(data),'POST')
// 12.申请配送员
export const applyDelivery = (data) => ajax(`${BASE_URL}/Shop/register_Delivery`,qs.stringify(data),'POST')
// 13.上传图片
export const uploadImg = (data) => ajax(`${BASE_URL}/school/upload_img`,data,'POST')
// 14.删除图片
export const delImg = (data) => ajax(`${BASE_URL}/school/delete_img`,qs.stringify(data),'POST')
// 15.查询用户申请状态
export const userStatus = (data) => ajax(`${BASE_URL}/shop/user_status`,qs.stringify(data),'POST')
// 16.添加购物车
export const addCart = (data) => ajax(`${BASE_URL}/Shop/add_cart`,qs.stringify(data),'POST')
//17.购物车商品加减
export const plusMinusCart = (data) => ajax(`${BASE_URL}/Shop/plus_minus_cart`,qs.stringify(data),'POST')
//18.获取购物车
export const cartList = (data) => ajax(`${BASE_URL}/Shop/cart_list`,qs.stringify(data),'POST')
//19.清空购物车
export const emptyCart = (data) => ajax(`${BASE_URL}/Shop/empty_cart`,qs.stringify(data),'POST')
//20.生成订单
export const newOrder = (data) => ajax(`${BASE_URL}/Order/new_order`,qs.stringify(data),'POST')
//21.支付接口
export const pay = (data) => ajax(`${BASE_URL}/Pay/JsApi`,qs.stringify(data),'POST')
//22.获取订单列表
export const orderList = (data) => ajax(`${BASE_URL}/Order/order_list`,qs.stringify(data),'POST')
//23.退款接口
export const refund = (data) => ajax(`${BASE_URL}/pay/refund`,qs.stringify(data),'POST')
//24.配送员获取订单列表
export const riderOrderList = (data) => ajax(`${BASE_URL}/Rider/order_list`,qs.stringify(data),'POST')
//25.配送员抢单
export const riderRob = (data) => ajax(`${BASE_URL}/Rider/rob_order`,qs.stringify(data),'POST')
//26.配送员收货
export const riderDelivery = (data) =>ajax(`${BASE_URL}/Rider/delivery_order`,qs.stringify(data),'POST')
//27.配送员确认送达
export const riderArrive = (data) => ajax(`${BASE_URL}/Rider/arrive_order`,qs.stringify(data),'POST')
//28.用户确认送达
export const userArrive = (data) => ajax(`${BASE_URL}/shop/arrive_order`,qs.stringify(data),'POST')
//29.用户评分
export const comment = (data) => ajax(`${BASE_URL}/order/comment`,qs.stringify(data),'POST')
//30.获取商户下评论
export const shopeva = (data) => ajax(`${BASE_URL}/shop/Order_review`,qs.stringify(data),'POST')
//31.微信分享
export const wxSign = (data) => ajax(`${BASE_URL}/WxSdk/get_sign`,qs.stringify(data),'POST')
//32.注册
export const register = (data) => ajax(`${BASE_URL}//login/register`,qs.stringify(data),'POST')
//33.配送统计
export const statistics = (data) => ajax(`${BASE_URL}/Rider/report`,qs.stringify(data),'POST')
//34.修改配送员接单状态
export const setDeliveryType = (data) => ajax(`${BASE_URL}/Shop/delivery_type`,qs.stringify(data),'POST')
//35.用户协商退款
export const applyRefund = (data) => ajax(`${BASE_URL}/order/Apply_refund`,qs.stringify(data),'POST')
//36.配送员协议
export const getConfig = () => ajax(`${BASE_URL}/login/get_config`,null,'POST')
//37.更新用户余额
export const updateMoney = (data) => ajax(`${BASE_URL}/shop/user_money`,data,'POST')
//38.获取验证码
export const SendMsg = (data) => ajax(`${BASE_URL}/login/send_msg`,qs.stringify(data),'POST')
//39.重置密码
export const rePwd = (data) => ajax(`${BASE_URL}/login/change_pwd`,qs.stringify(data),'POST')
//40.获取商品分类
export const classList = (data) => ajax(`${BASE_URL}/store/category_list`,qs.stringify(data),'POST')
//41.获取分类下的商家及其商品
export const cateidList = (data) => ajax(`${BASE_URL}/store/cateid_list`,qs.stringify(data),'POST')
//42.获取地址列表
export const addressList = (data) => ajax(`${BASE_URL}/Shop/address_list`,qs.stringify(data),'POST')
//43.添加地址
export const addAddress = (data) => ajax(`${BASE_URL}/Shop/add_address`,qs.stringify(data),'POST')
//44.删除地址
export const delAddress = (data) => ajax(`${BASE_URL}/Shop/del_address`,qs.stringify(data),'POST')
//45.获取订单详情
export const orderInfo = (data) => ajax(`${BASE_URL}/order/order_info`,qs.stringify(data),'POST')
//46.搜索订单
export const searchList = (data) => ajax(`${BASE_URL}/order/find_order_list`,qs.stringify(data),'POST')
//47.用户协议
export const userReg = () => ajax(`${BASE_URL}/login/getUserReg`,null,'POST')
//48.查询订单内商品是否售罄
export const findOrdersStock = (data) => ajax(`${BASE_URL}/order/find_order_stock`,data,'POST')
//49.首页banner图
export const banner = (data) => ajax(`${BASE_URL}/shop/banner`,data,'POST')